<?php

namespace app\admin\command;

use app\common\util\Tools;
use think\console\Input;
use think\console\Output;
use think\facade\Log;

class BannerTest extends CommonTest
{

    //再命令窗口中执行“php think interface-BannerTest”
    protected function configure()
    {
        $this->setName('interface-BannerTest')
            ->setDescription('接口测试');
    }

    public function execute(Input $input, Output $output)
    {
        parent::execute($input, $output);

//        $data = Tools::curl($this->url . "admin/banner/create", json_encode(["token" => "$this->token", "title" => "xxx", "icon" => "xx", "url" => "xxx"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

//        $data = Tools::curl($this->url . "admin/banner/getPageList", json_encode(["token" => "$this->token"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";
//
        $data = Tools::curl($this->url . "admin/banner/getDetailsById", json_encode(["token" => "$this->token", "id" => 1]));
        Log::write("post". var_export($data,true));
        echo $data . "\n\n";

    }
}
